package com.security.service;

import lombok.Getter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

/**
 * 用户信息拓展
 */
@Getter
public class TestUserDetails extends User {

	/**
	 * 用户id
	 */
	private Long userId;
	/**
	 * 昵称
	 */
	private String name;
	/**
	 * 真名
	 */
	private String realName;
	/**
	 * 账号
	 */
	private String account;

	public TestUserDetails(Long userId,String name, String realName, String username, String password,
						   boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired,
						   boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) {
		super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
		this.userId = userId;
		this.name = name;
		this.realName = realName;
		this.account = username;
	}

}
